package com.kly.pay.db.dao;
import com.fqgj.common.base.BaseMapper;
import com.kly.enums.PayTypeEnum;
import com.kly.pay.db.entity.POrderEntity;

import java.util.List;

/**
* User: linqu
* Date: 2023-06-06
* Time: 20:29:09.681
*/
public interface POrderDao  extends BaseMapper<POrderEntity> {


    /**
     * 根据订单编号与支付类型查询一笔支付订单记录
     * @param orderNo 订单编号
     * @param payType 支付类型：@see com.kly.enums.PayTypeEnum
     * @return 返回支付订单记录
     */
    POrderEntity queryByOrderNoAndPayType(String orderNo, String payType);

    POrderEntity queryByPayOrderNoAndPayType(String payOrderNo, String payType);

    /**
     * 支付处理中
     * @param payType 支付类型：@see com.kly.enums.PayTypeEnum
     * @return 返回支付订单记录
     */
    List<POrderEntity> queryProcessingRecords(Integer payType);

    POrderEntity queryByPayOrderNo(String payOrderNo);

    /**
     * 修改支付状态
     */
    int updateOrderStatus(String payOrderNo, Integer payType, Integer status);

    /**
     * 入账成功
     */
    int repaySuccess(String payOrderNo, Integer payType);

}